<include file="default/public/header_common" />
<style>
.am-list > li {
    position: relative;
    display: block;
    margin-bottom: -1px;
    background-color:initial;
    border: 1px solid #dedede;
    border-width: 1px 0;
	padding:15px;
}
.am-list > li > i {
	font-style:normal;
}
.head-css {
	background-color:#fff; 
	width:100%;
	height:auto;
	padding:20px 0;
}
.head-css label { text-align:right;}
</style>
<div class="head-css"> 
  <!--<div class="head-box">
  	<img src="<if condition="empty($userInfo['userPhoto'])">__PUBLIC__/images/default.jpg<else />/{$userInfo['userPhoto']}</if>" class="am-fr am-circle" width="180" height="180px">
  </div>-->
  
  <div class="am-form am-form-horizontal" style="padding:0 15px;"> <div class="am-form-group"
    <if condition="$src != 'userName'"> style="display:none;"</if>
    >
    <label for="doc-ipt-3" class="am-u-sm-3 am-form-label">昵称：</label>
    <div class="am-u-sm-9">
      <input type="text" id="userName" value="{$user['userName']}">
    </div>
  </div>
  <div class="am-form-group"
  <if condition="$src != 'userPhone'"> style="display:none;"</if>
  >
  <label for="doc-ipt-3" class="am-u-sm-3 am-form-label">手机号：</label>
  <div class="am-u-sm-9">
    <input type="text" id="userPhone" value="{$user['userPhone']}">
  </div>
</div>
<div class="am-form-group"
<if condition="$src != 'userSex'"> style="display:none;"</if>
>
<label for="doc-ipt-3" class="am-u-sm-3 am-form-label">性别：</label>
<div class="am-u-sm-9" style="margin-top:10px;"> &nbsp;&nbsp;&nbsp;<input type="radio" name="userSex" 
  <if condition="$user['userSex'] == 0"> checked</if>
  value="0">&nbsp;&nbsp;保密&nbsp;&nbsp;&nbsp;
  &nbsp;&nbsp;&nbsp;<input type="radio" name="userSex" 
  <if condition="$user['userSex'] == 1"> checked</if>
  value="1">&nbsp;&nbsp;男&nbsp;&nbsp;&nbsp;
  &nbsp;&nbsp;&nbsp;<input type="radio" name="userSex" 
  <if condition="$user['userSex'] == 2"> checked</if>
  value="2">&nbsp;&nbsp;女&nbsp;&nbsp;&nbsp; </div>
</div>
<div class="am-form-group">
  <div class="am-u-sm-9 am-u-sm-offset-3">
    <button class="am-btn am-btn-danger" onclick="upProfile()">确&nbsp;&nbsp;认</button>
  </div>
</div>
</div>
</div>
<script src="__ROOT__/Apps/Wap/View/default/assets/js/jquery.min.js"></script> 
<script src="__ROOT__/Apps/Wap/View/default/assets/js/amazeui.min.js"></script> 
<script src="__PUBLIC__/js/common.js"></script> 
<script type="text/javascript">
function upProfile() {
	var params = {};
	params.userName = $('#userName').val();
	params.userPhone = $('#userPhone').val();
	params.userSex = $("input[name='userSex']:checked").val();
	
	$.post("{:U('Wap/Users/upProfile')}",params,function(data,textStatus){
	   var json = MXC.toJson(data);
		if(json.code=='1'){
			alert(json.info);
			location.href= "{:U('Wap/Users/profile')}";
		}else{
			$("#errmsg").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + json.info);
		}
   });
}
</script>
</body>
</html>
